import request from "@/request/request"
import requestMock from "@/request/requestMock"

// 1.发送请求，获取三级分类列表
export const reqCategoryList = () => {
    return request.get("/product/getBaseCategoryList")
}

// 2.发送请求，获取banner列表
export const reqBannerList = () => {
    return requestMock.get("/banner/list")
}

// 3.发送请求，获取floor列表
export const reqFloorList = () => {
    return requestMock.get("/floor/list")
}

// 4.发送请求，获取search商品列表
export const reqSearchGoodsList = (params) => {
    return request.post("/list", params)
}

// 5.请求详情页的数据
export const reqDetailInfo = (skuId) => {
    return request.get(`/item/${ skuId }`)
}

// 6.添加购物车请求
export const reqAddToCart = (skuId, skuNum) => {
    return request.post(`/cart/addToCart/${ skuId }/${ skuNum }`)
}

// 7.获取购物车列表
export const reqCartList = () => {
    return request.get(`/cart/cartList`)
}